\(\int x^2 (A+B x) \sqrt {a+b x^2} \, dx\) [2]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 20, antiderivative size = 104 \[ \int x^2 (A+B x) \sqrt {a+b x^2} \, dx=-\frac {a A x \sqrt {a+b x^2}}{8 b}+\frac {B x^2 \left (a+b x^2\right )^{3/2}}{5 b}-\frac {(8 a B-15 A b x) \left (a+b x^2\right )^{3/2}}{60 b^2}-\frac {a^2 A \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{8 b^{3/2}} \]

[Out]

1/5*B*x^2*(b*x^2+a)^(3/2)/b-1/60*(-15*A*b*x+8*B*a)*(b*x^2+a)^(3/2)/b^2-1/8*a^2*A*arctanh(x*b^(1/2)/(b*x^2+a)^(
1/2))/b^(3/2)-1/8*a*A*x*(b*x^2+a)^(1/2)/b

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {847, 794, 201, 223, 212} \[ \int x^2 (A+B x) \sqrt {a+b x^2} \, dx=-\frac {a^2 A \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{8 b^{3/2}}-\frac {\left (a+b x^2\right )^{3/2} (8 a B-15 A b x)}{60 b^2}-\frac {a A x \sqrt {a+b x^2}}{8 b}+\frac {B x^2 \left (a+b x^2\right )^{3/2}}{5 b} \]

[In]

Int[x^2*(A + B*x)*Sqrt[a + b*x^2],x]

[Out]

-1/8*(a*A*x*Sqrt[a + b*x^2])/b + (B*x^2*(a + b*x^2)^(3/2))/(5*b) - ((8*a*B - 15*A*b*x)*(a + b*x^2)^(3/2))/(60*
b^2) - (a^2*A*ArcTanh[(Sqrt[b]*x)/Sqrt[a + b*x^2]])/(8*b^(3/2))

Rule 201

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[x*((a + b*x^n)^p/(n*p + 1)), x] + Dist[a*n*(p/(n*p + 1)),
 Int[(a + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && GtQ[p, 0] && (IntegerQ[2*p] || (EqQ[n, 2
] && IntegerQ[4*p]) || (EqQ[n, 2] && IntegerQ[3*p]) || LtQ[Denominator[p + 1/n], Denominator[p]])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 794

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((e*f + d*g)*(2*p
+ 3) + 2*e*g*(p + 1)*x)*((a + c*x^2)^(p + 1)/(2*c*(p + 1)*(2*p + 3))), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 847

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g*(d + e*x)^
m*((a + c*x^2)^(p + 1)/(c*(m + 2*p + 2))), x] + Dist[1/(c*(m + 2*p + 2)), Int[(d + e*x)^(m - 1)*(a + c*x^2)^p*
Simp[c*d*f*(m + 2*p + 2) - a*e*g*m + c*(e*f*(m + 2*p + 2) + d*g*m)*x, x], x], x] /; FreeQ[{a, c, d, e, f, g, p
}, x] && NeQ[c*d^2 + a*e^2, 0] && GtQ[m, 0] && NeQ[m + 2*p + 2, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ
[2*m, 2*p]) &&  !(IGtQ[m, 0] && EqQ[f, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {B x^2 \left (a+b x^2\right )^{3/2}}{5 b}+\frac {\int x (-2 a B+5 A b x) \sqrt {a+b x^2} \, dx}{5 b} \\ & = \frac {B x^2 \left (a+b x^2\right )^{3/2}}{5 b}-\frac {(8 a B-15 A b x) \left (a+b x^2\right )^{3/2}}{60 b^2}-\frac {(a A) \int \sqrt {a+b x^2} \, dx}{4 b} \\ & = -\frac {a A x \sqrt {a+b x^2}}{8 b}+\frac {B x^2 \left (a+b x^2\right )^{3/2}}{5 b}-\frac {(8 a B-15 A b x) \left (a+b x^2\right )^{3/2}}{60 b^2}-\frac {\left (a^2 A\right ) \int \frac {1}{\sqrt {a+b x^2}} \, dx}{8 b} \\ & = -\frac {a A x \sqrt {a+b x^2}}{8 b}+\frac {B x^2 \left (a+b x^2\right )^{3/2}}{5 b}-\frac {(8 a B-15 A b x) \left (a+b x^2\right )^{3/2}}{60 b^2}-\frac {\left (a^2 A\right ) \text {Subst}\left (\int \frac {1}{1-b x^2} \, dx,x,\frac {x}{\sqrt {a+b x^2}}\right )}{8 b} \\ & = -\frac {a A x \sqrt {a+b x^2}}{8 b}+\frac {B x^2 \left (a+b x^2\right )^{3/2}}{5 b}-\frac {(8 a B-15 A b x) \left (a+b x^2\right )^{3/2}}{60 b^2}-\frac {a^2 A \tanh ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{8 b^{3/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.84 \[ \int x^2 (A+B x) \sqrt {a+b x^2} \, dx=\frac {\sqrt {a+b x^2} \left (-16 a^2 B+6 b^2 x^3 (5 A+4 B x)+a b x (15 A+8 B x)\right )+15 a^2 A \sqrt {b} \log \left (-\sqrt {b} x+\sqrt {a+b x^2}\right )}{120 b^2} \]

[In]

Integrate[x^2*(A + B*x)*Sqrt[a + b*x^2],x]

[Out]

(Sqrt[a + b*x^2]*(-16*a^2*B + 6*b^2*x^3*(5*A + 4*B*x) + a*b*x*(15*A + 8*B*x)) + 15*a^2*A*Sqrt[b]*Log[-(Sqrt[b]
*x) + Sqrt[a + b*x^2]])/(120*b^2)

Maple [A] (verified)

Time = 3.39 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.77

method result size
risch \(\frac {\left (24 b^{2} B \,x^{4}+30 A \,b^{2} x^{3}+8 B a b \,x^{2}+15 a A b x -16 a^{2} B \right ) \sqrt {b \,x^{2}+a}}{120 b^{2}}-\frac {a^{2} A \ln \left (x \sqrt {b}+\sqrt {b \,x^{2}+a}\right )}{8 b^{\frac {3}{2}}}\) \(80\)
default \(B \left (\frac {x^{2} \left (b \,x^{2}+a \right )^{\frac {3}{2}}}{5 b}-\frac {2 a \left (b \,x^{2}+a \right )^{\frac {3}{2}}}{15 b^{2}}\right )+A \left (\frac {x \left (b \,x^{2}+a \right )^{\frac {3}{2}}}{4 b}-\frac {a \left (\frac {x \sqrt {b \,x^{2}+a}}{2}+\frac {a \ln \left (x \sqrt {b}+\sqrt {b \,x^{2}+a}\right )}{2 \sqrt {b}}\right )}{4 b}\right )\) \(96\)

[In]

int(x^2*(B*x+A)*(b*x^2+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/120*(24*B*b^2*x^4+30*A*b^2*x^3+8*B*a*b*x^2+15*A*a*b*x-16*B*a^2)/b^2*(b*x^2+a)^(1/2)-1/8*a^2*A/b^(3/2)*ln(x*b
^(1/2)+(b*x^2+a)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.68 \[ \int x^2 (A+B x) \sqrt {a+b x^2} \, dx=\left [\frac {15 \, A a^{2} \sqrt {b} \log \left (-2 \, b x^{2} + 2 \, \sqrt {b x^{2} + a} \sqrt {b} x - a\right ) + 2 \, {\left (24 \, B b^{2} x^{4} + 30 \, A b^{2} x^{3} + 8 \, B a b x^{2} + 15 \, A a b x - 16 \, B a^{2}\right )} \sqrt {b x^{2} + a}}{240 \, b^{2}}, \frac {15 \, A a^{2} \sqrt {-b} \arctan \left (\frac {\sqrt {-b} x}{\sqrt {b x^{2} + a}}\right ) + {\left (24 \, B b^{2} x^{4} + 30 \, A b^{2} x^{3} + 8 \, B a b x^{2} + 15 \, A a b x - 16 \, B a^{2}\right )} \sqrt {b x^{2} + a}}{120 \, b^{2}}\right ] \]

[In]

integrate(x^2*(B*x+A)*(b*x^2+a)^(1/2),x, algorithm="fricas")

[Out]

[1/240*(15*A*a^2*sqrt(b)*log(-2*b*x^2 + 2*sqrt(b*x^2 + a)*sqrt(b)*x - a) + 2*(24*B*b^2*x^4 + 30*A*b^2*x^3 + 8*
B*a*b*x^2 + 15*A*a*b*x - 16*B*a^2)*sqrt(b*x^2 + a))/b^2, 1/120*(15*A*a^2*sqrt(-b)*arctan(sqrt(-b)*x/sqrt(b*x^2
 + a)) + (24*B*b^2*x^4 + 30*A*b^2*x^3 + 8*B*a*b*x^2 + 15*A*a*b*x - 16*B*a^2)*sqrt(b*x^2 + a))/b^2]

Sympy [A] (verification not implemented)

Time = 0.42 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.17 \[ \int x^2 (A+B x) \sqrt {a+b x^2} \, dx=\begin {cases} - \frac {A a^{2} \left (\begin {cases} \frac {\log {\left (2 \sqrt {b} \sqrt {a + b x^{2}} + 2 b x \right )}}{\sqrt {b}} & \text {for}\: a \neq 0 \\\frac {x \log {\left (x \right )}}{\sqrt {b x^{2}}} & \text {otherwise} \end {cases}\right )}{8 b} + \sqrt {a + b x^{2}} \left (\frac {A a x}{8 b} + \frac {A x^{3}}{4} - \frac {2 B a^{2}}{15 b^{2}} + \frac {B a x^{2}}{15 b} + \frac {B x^{4}}{5}\right ) & \text {for}\: b \neq 0 \\\sqrt {a} \left (\frac {A x^{3}}{3} + \frac {B x^{4}}{4}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate(x**2*(B*x+A)*(b*x**2+a)**(1/2),x)

[Out]

Piecewise((-A*a**2*Piecewise((log(2*sqrt(b)*sqrt(a + b*x**2) + 2*b*x)/sqrt(b), Ne(a, 0)), (x*log(x)/sqrt(b*x**
2), True))/(8*b) + sqrt(a + b*x**2)*(A*a*x/(8*b) + A*x**3/4 - 2*B*a**2/(15*b**2) + B*a*x**2/(15*b) + B*x**4/5)
, Ne(b, 0)), (sqrt(a)*(A*x**3/3 + B*x**4/4), True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.83 \[ \int x^2 (A+B x) \sqrt {a+b x^2} \, dx=\frac {{\left (b x^{2} + a\right )}^{\frac {3}{2}} B x^{2}}{5 \, b} + \frac {{\left (b x^{2} + a\right )}^{\frac {3}{2}} A x}{4 \, b} - \frac {\sqrt {b x^{2} + a} A a x}{8 \, b} - \frac {A a^{2} \operatorname {arsinh}\left (\frac {b x}{\sqrt {a b}}\right )}{8 \, b^{\frac {3}{2}}} - \frac {2 \, {\left (b x^{2} + a\right )}^{\frac {3}{2}} B a}{15 \, b^{2}} \]

[In]

integrate(x^2*(B*x+A)*(b*x^2+a)^(1/2),x, algorithm="maxima")

[Out]

1/5*(b*x^2 + a)^(3/2)*B*x^2/b + 1/4*(b*x^2 + a)^(3/2)*A*x/b - 1/8*sqrt(b*x^2 + a)*A*a*x/b - 1/8*A*a^2*arcsinh(
b*x/sqrt(a*b))/b^(3/2) - 2/15*(b*x^2 + a)^(3/2)*B*a/b^2

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.78 \[ \int x^2 (A+B x) \sqrt {a+b x^2} \, dx=\frac {A a^{2} \log \left ({\left | -\sqrt {b} x + \sqrt {b x^{2} + a} \right |}\right )}{8 \, b^{\frac {3}{2}}} + \frac {1}{120} \, \sqrt {b x^{2} + a} {\left ({\left (2 \, {\left (3 \, {\left (4 \, B x + 5 \, A\right )} x + \frac {4 \, B a}{b}\right )} x + \frac {15 \, A a}{b}\right )} x - \frac {16 \, B a^{2}}{b^{2}}\right )} \]

[In]

integrate(x^2*(B*x+A)*(b*x^2+a)^(1/2),x, algorithm="giac")

[Out]

1/8*A*a^2*log(abs(-sqrt(b)*x + sqrt(b*x^2 + a)))/b^(3/2) + 1/120*sqrt(b*x^2 + a)*((2*(3*(4*B*x + 5*A)*x + 4*B*
a/b)*x + 15*A*a/b)*x - 16*B*a^2/b^2)

Mupad [F(-1)]

Timed out. \[ \int x^2 (A+B x) \sqrt {a+b x^2} \, dx=\int x^2\,\sqrt {b\,x^2+a}\,\left (A+B\,x\right ) \,d x \]

[In]

int(x^2*(a + b*x^2)^(1/2)*(A + B*x),x)

[Out]

int(x^2*(a + b*x^2)^(1/2)*(A + B*x), x)